<?php

include '../php-ofc-library/open-flash-chart.php';

$data_1 = array();
$data_2 = array();

srand((double)microtime()*1000000);
$data = array();
for( $i=0; $i<10; $i++ )
  $data[] = rand(15,100);

for( $i=0; $i<5; $i++ )
{
  $data_1[] = (sin(rand(0,6)) * 4.9) + 10;
  $data_2[] = (sin(rand(0,6)) * 2.9) + 4;
}

$title = new title( 'Chart 2: XXX' );
$title->set_style('{font-size: 20px; color:#000000; font-family: Verdana; text-align: center}');

$line_1 = new line();
$line_1->set_default_dot_style(new hollow_dot());
$line_1->set_values( $data_1 );
$line_1->set_width( 3 );
//$line_1->line_style( new line_style(10, 10) );
$line_1->set_colour( '#668053' );

$line_2 = new line();
$line_2->set_default_dot_style(new solid_dot());
$line_2->set_values( $data_2 );
$line_2->set_width( 1 );
$line_2->line_style( new line_style(5, 5) );
$line_2->set_colour( '#C95653' );

//set labels here
$x_labels=new x_axis_labels();
$x_labels->set_labels(array('XL_1','XL_2','XL_3','XL_4','XL_5'));
$x_axis = new x_axis();
$x_axis->set_labels($x_labels);
$x_legend = new x_legend( 'X Legend' );
$x_legend->set_style( '{font-size: 16px; color: #000000}' );

$y_axis = new y_axis();
$y_axis->set_range( 0, 15, 5 );//set_range(min,max,step)
$y_legend = new y_legend( 'Y Legend' );
$y_legend->set_style( '{font-size: 16px; color: #000000}' );



$chart = new open_flash_chart();
$chart->set_title( $title );
$chart->set_bg_colour( '#FFFFFF' );
$chart->add_element( $line_1 );
$chart->add_element( $line_2 );
$chart->set_x_axis( $x_axis );
$chart->set_y_axis( $y_axis );
$chart->set_x_legend( $x_legend );
$chart->set_y_legend( $y_legend );


echo $chart->toPrettyString();

?>
